//在uitl工具类中实现防抖方法（debounce） 

export const debounce =(fn,delay=1000)=>{
    let timer = null 
    return (...args)=>{
        clearTimeout(timer)
        timer =setTimeout(()=>{
            fn.apply(this,args)
        },delay)
    }

}